home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / tcp_ip / tnos / tnos100s / arcdump.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-04-30  |  833 b   |  50 lines

  1. /* ARCNET trace routines
  2.  * Copyright 1990 Russ Nelson
  3.  */
  4.  
  5. #include <stdio.h>
  6. #include "global.h"
  7. #include "mbuf.h"
  8. #include "arcnet.h"
  9. #include "trace.h"
  10.  
  11. #ifdef TNOS_68K
  12. #define fprintf traceprintf
  13. #endif
  14.  
  15. void
  16. arc_dump(fp,bpp,check)
  17. FILE *fp;
  18. struct mbuf **bpp;
  19. int check;    /* Not used */
  20. {
  21.     struct arc ahdr;
  22.     char s[20],d[20];
  23.  
  24.     ntoharc(&ahdr,bpp);
  25.     parc(s,ahdr.source);
  26.     parc(d,ahdr.dest);
  27.     fprintf(fp,"Arcnet: len %u %s->%s",ARCLEN + len_p(*bpp),s,d);
  28.  
  29.     switch(uchar(ahdr.type)){
  30.         case ARC_IP:
  31.             fprintf(fp," type IP\n");
  32.             ip_dump(fp,bpp,1);
  33.             break;
  34.         case ARC_ARP:
  35.             fprintf(fp," type ARP\n");
  36.             arp_dump(fp,bpp);
  37.             break;
  38.         default:
  39.             fprintf(fp," type 0x%x\n",ahdr.type);
  40.             break;
  41.     }
  42. }
  43. int
  44. arc_forus(iface,bp)
  45. struct iface *iface;
  46. struct mbuf *bp;
  47. {
  48.     return 1;
  49. }
  50.